.class final Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor$ImageCallback;
.super Lcom/burstly/lib/network/request/DefaultRequestCallback;
.source "BurstlyImageAdaptor.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x1a
    name = "ImageCallback"
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lcom/burstly/lib/network/request/DefaultRequestCallback",
        "<",
        "Landroid/graphics/Bitmap;",
        ">;"
    }
.end annotation


# instance fields
.field private final mAdaptor:Ljava/lang/ref/Reference;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/lang/ref/Reference",
            "<",
            "Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor;",
            ">;"
        }
    .end annotation
.end field

.field private mIsInterstitial:Z

.field private mIsPrecache:Z


# direct methods
.method private constructor <init>(Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor;)V
    .locals 1
    .parameter "adaptor"

    .prologue
    .line 95
    invoke-direct {p0}, Lcom/burstly/lib/network/request/DefaultRequestCallback;-><init>()V

    .line 96
    new-instance v0, Ljava/lang/ref/WeakReference;

    invoke-direct {v0, p1}, Ljava/lang/ref/WeakReference;-><init>(Ljava/lang/Object;)V

    iput-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor$ImageCallback;->mAdaptor:Ljava/lang/ref/Reference;

    .line 97
    return-void
.end method

.method synthetic constructor <init>(Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor;Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor$1;)V
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 73
    invoke-direct {p0, p1}, Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor$ImageCallback;-><init>(Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor;)V

    return-void
.end method

.method static synthetic access$500(Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor$ImageCallback;Z)V
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 73
    invoke-direct {p0, p1}, Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor$ImageCallback;->setIsInterstitial(Z)V

    return-void
.end method

.method static synthetic access$600(Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor$ImageCallback;Z)V
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 73
    invoke-direct {p0, p1}, Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor$ImageCallback;->setPrecache(Z)V

    return-void
.end method

.method private setIsInterstitial(Z)V
    .locals 0
    .parameter "interstitial"

    .prologue
    .line 131
    iput-boolean p1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor$ImageCallback;->mIsInterstitial:Z

    .line 132
    return-void
.end method

.method private setPrecache(Z)V
    .locals 0
    .parameter "isPrecache"

    .prologue
    .line 140
    iput-boolean p1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor$ImageCallback;->mIsPrecache:Z

    .line 141
    return-void
.end method


# virtual methods
.method public onFailUi(Landroid/graphics/Bitmap;)V
    .locals 6
    .parameter "param"

    .prologue
    const/4 v5, 0x0

    .line 118
    iget-object v1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor$ImageCallback;->mAdaptor:Ljava/lang/ref/Reference;

    invoke-virtual {v1}, Ljava/lang/ref/Reference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor;

    .line 119
    .local v0, adaptor:Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor;
    if-eqz v0, :cond_0

    invoke-virtual {v0}, Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor;->isStopped()Z

    move-result v1

    if-nez v1, :cond_0

    .line 120
    invoke-static {}, Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor;->access$300()Lcom/burstly/lib/util/LoggerExt;

    move-result-object v1

    #getter for: Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor;->mTag:Ljava/lang/String;
    invoke-static {v0}, Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor;->access$200(Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor;)Ljava/lang/String;

    move-result-object v2

    const-string v3, "Image was not fetched. See log for details."

    new-array v4, v5, [Ljava/lang/Object;

    invoke-virtual {v1, v2, v3, v4}, Lcom/burstly/lib/util/LoggerExt;->logError(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 121
    invoke-virtual {v0}, Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor;->getAdaptorListener()Lcom/burstly/lib/component/IBurstlyAdaptorListener;

    move-result-object v1

    const-string v2, "burstlyImage"

    const-string v3, ""

    invoke-interface {v1, v2, v5, v3}, Lcom/burstly/lib/component/IBurstlyAdaptorListener;->failedToLoad(Ljava/lang/String;ZLjava/lang/String;)V

    .line 123
    :cond_0
    return-void
.end method

.method public bridge synthetic onFailUi(Ljava/lang/Object;)V
    .locals 0
    .parameter "x0"

    .prologue
    .line 73
    check-cast p1, Landroid/graphics/Bitmap;

    .end local p1
    invoke-virtual {p0, p1}, Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor$ImageCallback;->onFailUi(Landroid/graphics/Bitmap;)V

    return-void
.end method

.method public onSuccessUi(Landroid/graphics/Bitmap;)V
    .locals 6
    .parameter "param"

    .prologue
    .line 101
    iget-object v2, p0, Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor$ImageCallback;->mAdaptor:Ljava/lang/ref/Reference;

    invoke-virtual {v2}, Ljava/lang/ref/Reference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor;

    .line 103
    .local v0, adaptor:Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor;
    if-eqz v0, :cond_0

    invoke-virtual {v0}, Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor;->isStopped()Z

    move-result v2

    if-nez v2, :cond_0

    .line 104
    iget-boolean v2, p0, Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor$ImageCallback;->mIsInterstitial:Z

    if-nez v2, :cond_1

    .line 105
    iget-object v1, v0, Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor;->mImage:Landroid/widget/ImageView;

    .line 106
    .local v1, image:Landroid/widget/ImageView;
    const/4 v2, 0x1

    invoke-virtual {v1, v2}, Landroid/widget/ImageView;->setAdjustViewBounds(Z)V

    .line 107
    invoke-virtual {v1, p1}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V

    .line 108
    invoke-virtual {v0}, Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor;->getAdaptorListener()Lcom/burstly/lib/component/IBurstlyAdaptorListener;

    move-result-object v2

    const-string v3, "burstlyImage"

    iget-boolean v4, p0, Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor$ImageCallback;->mIsInterstitial:Z

    invoke-interface {v2, v3, v4}, Lcom/burstly/lib/component/IBurstlyAdaptorListener;->didLoad(Ljava/lang/String;Z)V

    .line 109
    invoke-static {}, Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor;->access$100()Lcom/burstly/lib/util/LoggerExt;

    move-result-object v2

    #getter for: Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor;->mTag:Ljava/lang/String;
    invoke-static {v0}, Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor;->access$000(Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor;)Ljava/lang/String;

    move-result-object v3

    const-string v4, "Image fetched by url came from burstly."

    const/4 v5, 0x0

    new-array v5, v5, [Ljava/lang/Object;

    invoke-virtual {v2, v3, v4, v5}, Lcom/burstly/lib/util/LoggerExt;->logInfo(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 114
    .end local v1           #image:Landroid/widget/ImageView;
    :cond_0
    :goto_0
    return-void

    .line 111
    :cond_1
    iget-boolean v2, p0, Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor$ImageCallback;->mIsPrecache:Z

    invoke-static {p1, v2, v0}, Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor;->handleInterstitial(Landroid/graphics/Bitmap;ZLcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor;)V

    goto :goto_0
.end method

.method public bridge synthetic onSuccessUi(Ljava/lang/Object;)V
    .locals 0
    .parameter "x0"

    .prologue
    .line 73
    check-cast p1, Landroid/graphics/Bitmap;

    .end local p1
    invoke-virtual {p0, p1}, Lcom/burstly/lib/component/networkcomponent/burstly/BurstlyImageAdaptor$ImageCallback;->onSuccessUi(Landroid/graphics/Bitmap;)V

    return-void
.end method
